package com.itheima.tlias84.aop.cglib;

import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class EatInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
        //调用父类的方法
        System.out.println("刷牙");
        Object o = proxy.invokeSuper(obj, args);
        System.out.println("洗手");
        return o;
    }
}
